<?php
/**
 * Create By: PhpStorm
 * User: yihua
 * File: GetCategoryInfo.php
 * Date: 2017/2/26
 * Time: 22:16
 */
namespace app\home\model\page\shop;

use app\api\model\dao\GoodsCategory;
use app\library\Error;
use app\library\PageBase;

class GetCategoryInfo extends PageBase
{
    public function __construct()
    {
        parent::__construct();
    }

    public function excute($param)
    {
        $ret = $this->checkToken($param);
        if (false === $ret) {
            return $this->getRes(Error::ERR_NO_AUTH);
        }

        $obj = new GoodsCategory();
        $catInfo = $obj->getAllGoodsCategory();
        if (false === $catInfo) {
            return $this->getRes(Error::ERR_SYS);
        }
        $this->data = $catInfo;
        return $this->getRes();
    }
}